﻿<%@ Page Title="" Language="C#" MasterPageFile="~/views/customer/customermaster.master" AutoEventWireup="true" CodeFile="sp5.aspx.cs" Inherits="sp5" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style1 {
            width: 349px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MyContent" Runat="Server">
    <div class="container-fluid">
       <div class="row">
           <div class="col">
               <h3 class="text-center" style="color: white">商品添加</h3>

           </div>
    <table class="w-100">
        <tr>
            <td class="auto-style1">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="LinqDataSource1" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical" Height="347px" Width="460px">
                    <AlternatingRowStyle BackColor="#CCCCCC" />
                    <Columns>
                        <asp:BoundField DataField="ProductID" HeaderText="商品编号" InsertVisible="False" ReadOnly="True" SortExpression="ProductID" />
                        <asp:BoundField DataField="ProductName" HeaderText="商品名称" SortExpression="ProductName" />
                        <asp:CommandField SelectText="详细资料" ShowSelectButton="True" HeaderText="详细资料" />
                    </Columns>
                    <FooterStyle BackColor="#CCCCCC" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="Gray" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
&nbsp; </td>
            <td>
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" BackColor="White" HeaderText="详细资料" OnItemDeleted="DetailsView1_ItemDeleted1" OnItemInserted="DetailsView1_ItemInserted1" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="ProductID" DataSourceID="LinqDataSource2" ForeColor="Black" GridLines="Vertical" Height="86px" Width="759px">
                    <AlternatingRowStyle BackColor="#CCCCCC" />
                    <EditRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                    <Fields>
                        <asp:BoundField DataField="ProductID" HeaderText="商品编号" InsertVisible="False" ReadOnly="True" SortExpression="ProductID">
                        <ControlStyle Width="20px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ProductName" HeaderText="商品名称" SortExpression="ProductName" />
                        <asp:BoundField DataField="ProductPrice" HeaderText="商品价格" SortExpression="ProductPrice" />
                        <asp:BoundField DataField="ProductDescription" HeaderText="商品描述" SortExpression="ProductDescription" />
                        <asp:BoundField DataField="ProductStock" HeaderText="库存" SortExpression="ProductStock" />
                        <asp:BoundField DataField="MerchantID" HeaderText="供应商ID" SortExpression="MerchantID" />
                        <asp:BoundField DataField="Producttypeid" HeaderText="类型编号" SortExpression="Producttypeid" />
                        <asp:ImageField DataImageUrlField="ProductImage" HeaderText="图片">
                            <ControlStyle Height="300px" Width="350px" />
                        </asp:ImageField>
                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                    </Fields>
                    <FooterStyle BackColor="#CCCCCC" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                </asp:DetailsView>
                <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="PJTY.dal.DataClasses1DataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" EntityTypeName="" TableName="Product1" Where="ProductID == @ProductID">
                    <WhereParameters>
                        <asp:ControlParameter ControlID="GridView1" DefaultValue="1" Name="ProductID" PropertyName="SelectedValue" Type="Int32" />
                    </WhereParameters>
                </asp:LinqDataSource>
            </td>
        </tr>
    </table>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="PJTY.dal.DataClasses1DataContext" EntityTypeName="" TableName="Product1"></asp:LinqDataSource>
    </asp:Content>

